<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNodesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nodes', function (Blueprint $table) {
            $table->bigIncrements("id");
            $table->string("node_name",50)->comment("节点名称");
            $table->string("route_name", 50)->nullable()->default("")->comment("路由名称，权限认证识别");
            $table->unsignedInteger("pid")->default(0)->comment("上级ID");
            $table->enum("is_menu",["0","1"])->default("0")->comment("是否为菜单，0 为 否，1 为 是");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nodes');
    }
}
